package handlers

import (
	"bloggo/bloggo"
	"bloggo/dto"
	"bloggo/structs"
	"gitee.com/chunanyong/zorm"
	"github.com/gin-gonic/gin"
)

func Links(c *gin.Context) *bloggo.R {
	var links []dto.Link
	finder := zorm.NewFinder().Append("SELECT * FROM").Append(structs.TbFriendLinkStructTableName)
	err := zorm.Query(c, finder, &links, nil)
	if err != nil {
		return bloggo.FailMessage(err.Error())
	}
	return bloggo.OkData(links)
}
